fix: re-enable LAN after stopping SD card logging#159
Merged
Conversation
StartSdCardLoggingAsync disables LAN (SD card and WiFi share the SPI bus), but StopSdCardLoggingAsync never re-enabled it. This left WiFi/LAN silently disabled after SD logging was stopped. Every other SD operation (GetSdCardFilesAsync, DeleteSdCardFileAsync, DownloadSdCardFileAsync) correctly restored LAN in their finally blocks via PrepareLanInterface(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: a0fb8798807b
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan Review Summary by QodoRe-enable LAN after stopping SD card logging
WalkthroughsDescription• Re-enable LAN interface after stopping SD card logging • StartSdCardLoggingAsync disables LAN (shared SPI bus), but StopSdCardLoggingAsync never restored it • Left WiFi/LAN silently disabled after SD logging sessions • Updated test to verify LAN re-enable command is sent Diagramflowchart LR
A["StartSdCardLoggingAsync<br/>disables LAN"] --> B["SD card logging active"]
B --> C["StopSdCardLoggingAsync"]
C --> D["Stop stream data"]
D --> E["Disable SD storage"]
E --> F["Restore USB interface"]
F --> G["Re-enable LAN interface<br/>NEW"]
G --> H["LAN restored"]
File Changes1. src/Daqifi.Core/Device/DaqifiStreamingDevice.cs
|
Code Review by Qodo
1.
|
StopStreaming() is a no-op when IsStreaming is false, but IsStreaming can be stale (issue #118). Other SD operations already use the defensive pattern of unconditionally sending the stop command. Apply the same pattern here and add a test verifying the command is sent even when IsStreaming is false. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StopSdCardLoggingAsync()never re-enabled the LAN interface after stopping SD card logging.StartSdCardLoggingAsync()disables LAN because the SD card and WiFi share the SPI bus, but the stop method only disabled SD storage and restored the stream interface to USB — it never sentSYSTem:COMMunicate:LAN:ENAbled 1.GetSdCardFilesAsync,DeleteSdCardFileAsync,DownloadSdCardFileAsync) correctly restored LAN viaPrepareLanInterface()in theirfinallyblocks.StopSdCardLoggingAsync_SendsCorrectCommandsasserted only 3 commands (matching the buggy behavior). Updated to assert 4 commands including the LAN re-enable.Test plan
🤖 Generated with Claude Code